<template>
  <div>
    <a-card>
      <a-row style="margin-bottom: 10px">
        <a-col :span="24"  style="display: flex;flex-direction: row-reverse">
          <a-button v-print="'#printReport'" type="primary">打印报表</a-button>
        </a-col>
      </a-row>
      <div id="printReport">
        <table border="1" cellpadding="4" cellspacing="0" bordercolor="#000" style="width: 100%">
          <tr>
            <th colspan="13">
              <div style="position: relative;text-align: center">
                <span>{{reportData.title}}</span>
              </div>
            </th>
          </tr>
          <tr>
            <td colspan="13">
              <a-row>
                <a-col :span="12">线别：{{reportData.lineType}}</a-col>
                <a-col :span="12" style="text-align: right">
                  {{ reportData.createTime }}
                </a-col>
              </a-row>
            </td>
          </tr>
          <tr v-if="reportData.dayCheckName.length > 0">
            <td>一.开线前必须确认项目</td>
            <td colspan="6" style="text-align: center">白班</td>
            <td colspan="6" style="text-align: center">夜班</td>
          </tr>
          <tr v-for="(item,index) in reportData.dayCheckName" v-if="reportData.dayCheckName.length > 0">
            <td>{{index + 1 + '.'+item}}</td>
            <td colspan="6">{{reportData.dayCheckList[index][0].inspectionResults}}</td>
            <td colspan="6">{{reportData.dayCheckList[index][1].inspectionResults}}</td>
          </tr>
          <tr v-if="reportData.dayCheckName.length > 0">
            <td style="text-align: center">签名</td>
            <td colspan="6">{{reportData.dayCheckList[0][0].maintainer}}</td>
            <td colspan="6">{{reportData.dayCheckList[0][1].maintainer}}</td>
          </tr>
          <tr v-if="reportData.weekCheckList.length > 0">
            <td>1.手动清洁钢板记录</td>
            <td>8:00</td>
            <td>10:00</td>
            <td>12:00</td>
            <td>14:00</td>
            <td>16:00</td>
            <td>18:00</td>
            <td>20:00</td>
            <td>22:00</td>
            <td>0:00</td>
            <td>2:00</td>
            <td>4:00</td>
            <td>6:00</td>
          </tr>
          <tr v-if="reportData.weekCheckList.length > 0">
            <td style="text-align: center">签名</td>
            <td v-for="i in reportData.weekCheckList[0]">{{i.maintainer}}</td>
          </tr>
          <tr v-if="reportData.monthCheckName.length > 0">
            <td>三.钢板清洗后必须确认项目 (由技术员填写)</td>
            <td colspan="6" style="text-align: center">日班</td>
            <td colspan="6" style="text-align: center">夜班</td>
          </tr>
          <tr v-for="(item,index) in reportData.monthCheckName" v-if="reportData.monthCheckName.length > 0">
            <td>{{index + 1 +'.'+item}}</td>
            <td colspan="6">{{reportData.monthCheckList[index][0].inspectionResults}}</td>
            <td colspan="6">{{reportData.monthCheckList[index][1].inspectionResults}}</td>
          </tr>
          <tr v-if="reportData.monthCheckName.length > 0">
            <td style="text-align: center">签名</td>
            <td colspan="6">{{reportData.dayCheckList[0][0].maintainer}}</td>
            <td colspan="6">{{reportData.dayCheckList[0][1].maintainer}}</td>
          </tr>
          <tr>
            <td colspan="13">
              生产过程注意事项:{{reportData.beCareful}}
            </td>
          </tr>
          <tr>
            <td colspan="13">生产主管：{{reportData.reviewer}}</td>
          </tr>
          <tr>
            <td colspan="13">编号：{{reportData.documentNumber}}     版本 : 1    保密等级：一般   使用形式：纸质档   保存期限 :2年     销毁方式：双面使用</td>
          </tr>
        </table>
      </div>
    </a-card>
  </div>
</template>

<script>
export default {
  /** SMT印刷机< SPG >作业记录表 **/
  name: 'SMTMachineOperationRecordSheet',
  props:{
    reportData:{
      type:Object,
      default:()=>{}
    },
    type:{
      type:String,
      default:''
    }
  },
  data(){
    return {
      checkList1:[
        {
          checkName:'生产机型',
          measure:'1'
        },
        {
          checkName:'程式名称',
          measure:'2'
        },
      ],
      checkList2:[
        {
          checkName:'印刷治具(钢板, Support, 刮刀等)是否清洁干净',
          measure:'1'
        },
        {
          checkName:'钢板清洁后孔壁是否有锡粉残留',
          measure:'2'
        },
        {
          checkName:'PCB夹边是否有磨损',
          measure:'2'
        },
      ],
    }
  }
}
</script>

<style scoped>

</style>